.xq-container {
  display: flex;
  flex-direction: column;
  height: 94vh;
  background-color: #f8f8f8;
}

.xq-header {
  display: flex;
  align-items: center;
  padding: 0px 10px 16px;
  background-color: rgb(243, 241, 241);
  position: relative;
}

.yuimg {
  width: 100px;
  height: 100px;
  object-fit: cover;
}

.back-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 8px;
  margin-right: 16px;
  border-radius: 50%;
  transition: background-color 0.2s;
  color: #333;
}

.back-btn:hover {
  background-color: #f0f0f0;
}

.xq-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  flex: 1;
  text-align: center;
  margin-right: 70px; /* 为了平衡左侧返回按钮 */
}

/* 用户信息区域 */
.user-info-section {
  background-color: white;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  flex-direction: row;
}

.profile-picture {
  width: 45px;
  height: 45px;
  margin-right: 16px;
}

/* 确保用户头像正确显示 */
.profile-picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  background-color: #f0f0f0;
}

.user-details {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.user-name {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

.add-member-btn {
  width: 40px;
  height: 40px;
  border: 2px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 20px;
  font-weight: bold;
}

/* 设置列表 */
.settings-list {
  background-color: white;
  border-radius: 0;
}

.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  color: #333;
}

.setting-item:last-child {
  border-bottom: none;
}

.arrow {
  color: #ccc;
  font-size: 18px;
  font-weight: bold;
}

/* 开关按钮样式 */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 30px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 30px;
}

.slider:before {
  position: absolute;
  content: '';
  height: 26px;
  width: 26px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: #4caf50;
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* 移除之前的样式 */
.xq-content {
  display: none;
}

.xq-content h2 {
  display: none;
}

.xq-content p {
  display: none;
}

/* 错误消息样式 */
.error-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.error-message p {
  color: #666;
  margin-bottom: 20px;
  font-size: 16px;
}

.back-button {
  background-color: #007aff;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.back-button:hover {
  background-color: #0056cc;
}

/* 背景选择弹窗样式 */
.background-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.background-modal {
  background-color: white;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 16px 20px;
  border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.close-btn:hover {
  background-color: #f0f0f0;
}

.background-options {
  padding: 20px;
}

.background-options h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.preset-backgrounds {
  margin-bottom: 24px;
}

.background-grid {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
}

.background-grid::-webkit-scrollbar {
  height: 6px;
}

.background-grid::-webkit-scrollbar-track {
  background: transparent;
}

.background-grid::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 3px;
}

.background-grid::-webkit-scrollbar-thumb:hover {
  background-color: #999;
}

.background-item {
  width: 100px;
  height: 200px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
  flex-shrink: 0;
}

.background-item:hover {
  border-color: #007aff;
  transform: scale(1.05);
}

.background-item.selected {
  border-color: #007aff;
  box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

.background-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.background-item.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: #007aff;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

.local-image-upload {
  margin-bottom: 24px;
}

.upload-btn {
  display: inline-block;
  background-color: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #6c757d;
}

.upload-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
  color: #495057;
}

.upload-btn span {
  font-size: 14px;
  font-weight: 500;
}

.current-background {
  margin-bottom: 16px;
}

.current-bg-preview {
  width: 100%;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e9ecef;
}

.current-bg-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 清空聊天记录弹窗样式 */
.clear-chat-content {
  padding: 20px;
  text-align: center;
}

.clear-chat-content p {
  margin: 0 0 16px 0;
  font-size: 16px;
  color: #333;
  line-height: 1.5;
}

.clear-chat-content strong {
  color: #007aff;
}

.clear-chat-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

.cancel-btn {
  background-color: #f8f9fa;
  color: #6c757d;
  border: 1px solid #dee2e6;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  min-width: 80px;
}

.cancel-btn:hover {
  background-color: #e9ecef;
  color: #495057;
}

.confirm-btn {
  background-color: #dc3545;
  color: white;
  border: 1px solid #dc3545;
  padding: 10px 125px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
  min-width: 80px;
}

.confirm-btn:hover {
  background-color: #c82333;
  border-color: #c82333;
}

.confirm-btn:disabled {
  background-color: #6c757d;
  border-color: #6c757d;
  cursor: not-allowed;
}

.confirm-btn:disabled:hover {
  background-color: #6c757d;
  border-color: #6c757d;
}

/* 响应式设计 */
@media (max-width: 480px) {
  .background-modal {
    width: 95%;
    margin: 20px;
  }

  .background-grid {
    gap: 8px;
  }

  .modal-header {
    padding: 16px 16px 12px 16px;
  }

  .background-options {
    padding: 16px;
  }

  .clear-chat-actions {
    flex-direction: column;
    gap: 8px;
  }

  .cancel-btn,
  .confirm-btn {
    width: 100%;
  }
}
